<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.anhry.www.safety.util.Util"/>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>运城市安全生产隐患排查治理信息系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath%>/css/style.css" rel="stylesheet" type="text/css"/>
	<script src="<%=basePath%>/js/js.js" type="text/javascript"></script>
	<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/check_jquery.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/addfj.js"></script>
	<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js" defer="defer"></script><base target="_self" />
	<style>
		.menuhidden {display:none;float:none}
		.menuvisible {display:block;float:none}
	</style>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#addMoreyh").click(function(){//附件添加
				addFj('moreyh','yhFile');
			});
			$("#addMorezg").click(function(){//附件添加	
				addFj('morezg','picFile');
			});
			$("#addMoredoc").click(function(){//附件添加
				addFj('moredoc','docFile');
			});
			
			var iszg='${yh.yhIsZg}';
		    if(iszg=="1"){
				$("#wc").removeClass("menuhidden");
				$("#wc").addClass("menuvisible");
				$("#qx").removeClass("menuvisible");
				$("#qx").addClass("menuhidden");
			}else{
				$("#qx").removeClass("menuhidden");
				$("#qx").addClass("menuvisible");
				$("#wc").removeClass("menuvisible");
				$("#wc").addClass("menuhidden");
			}
			
			$("input[name='yhIsZg']").click(function(){
				var vals=$("input[name='yhIsZg']:checked").val();
				if(vals=="1"){
					$("input[name='yhGzTime']").val("");
					$("#wc").removeClass("menuhidden");
					$("#wc").addClass("menuvisible");
					$("#qx").removeClass("menuvisible");
					$("#qx").addClass("menuhidden");
				}else{
					$("input[name='yhWcTime']").val("");
					$("#qx").removeClass("menuhidden");
					$("#qx").addClass("menuvisible");
					$("#wc").removeClass("menuvisible");
					$("#wc").addClass("menuhidden");
				}
			});
		});
		function toback(){
			document.form1.action='<%=basePath%>/zczb/_bzhList.action';
			document.form1.submit();
		}
		function deleFj(id,vname){
			var vids=vname+id;
			$.ajax({
				type:"POST",
				url:"<%=basePath%>/zczb/_deleFj.action?fjId="+id,
				success:function(data){
					if(data=="1"){
						document.getElementById(vids).style.display="none";
					}else{
						alert('删除失败！');
					}		  			
			    }
			});				
		}
	</script>
  </head>
  
 <body style="background: #fff">
 	<form action="<%=basePath%>/zczb/_saveYh.action" name="form1" method="post" enctype="multipart/form-data">
		<table border="0" cellpadding="0" cellspacing="0" align="center" class="infolist" style="width: 99%;">
			<tr>
				<td class="info_tit" width="150" style="border-top:none">隐患类型：</td>
				<td>${yh.yhType1Name }——${yh.yhType2Name }——${yh.yhType3 }——${yh.yhType4 } </td>
			</tr>
			<tr>
				<td class="info_tit">自查标准：</td>
				<td>${yh.yhInfo }</td>
			</tr>
			<tr>
				<td class="info_tit">发现时间：</td>
				<td><input type="text" name="yhFxTime" type="text" id="byear1" value="<s:date name="yh.yhFxTime" format="yyyy-MM-dd"/>" class="Wdate" onclick="WdatePicker({readOnly:true,maxDate:'%y-%M-%d'});"/><span class="note4">*</span></td>
			</tr>
			<tr>
				<td class="info_tit">隐患基本情况：</td>
				<td><textarea rows="2" cols="45" name="yhQk" id="bit1">${yh.yhQk }</textarea><span class="note4">*</span></td>
			</tr>
			<s:if test="%{yhType==2}">
				<tr>
					<td class="info_tit">隐患形成详细原因：</td>
					<td><textarea rows="2" cols="45" name="yhXcyy" id="bit2">${yh.yhXcyy }</textarea><span class="note4">*</span></td>
				</tr>
				<tr>
					<td class="info_tit">影响范围及危害后果：</td>
					<td><textarea rows="2" cols="45" name="yhYxfw" id="bit3">${yh.yhYxfw }</textarea><span class="note4">*</span></td>
				</tr>
				<tr>
					<td class="info_tit">监控及治理措施：</td>
					<td><textarea rows="2" cols="45" name="yhJkcs" id="bit4">${yh.yhJkcs }</textarea><span class="note4">*</span></td>
				</tr>
			</s:if>
			<tr>
				<td class="info_tit">隐患是否已整改：</td>
				<td>
					<span style="float:left;margin-right:20px;"><s:radio list="#{'1':'是','0':'否'}" name="yhIsZg" value="%{yh.yhIsZg}" theme="simple"/></span>
					<span id="wc">
						整改完成日期：
						<input type="text" name="yhWcTime" value="<s:date name="yh.yhWcTime" format="yyyy-MM-dd"/>" type="text" id="reportWcTime" class="Wdate" onclick="WdatePicker({readOnly:true,minDate:'#F{$dp.$D(\'byear1\')}'})"/>
					</span>
					<span id="qx" class="menuhidden">
						整改期限：
						<input type="text" name="yhGzTime" value="<s:date name="yh.yhZgTime" format="yyyy-MM-dd"/>" type="text" id="reportGzTime" class="Wdate" onclick="WdatePicker({readOnly:true,minDate:'#F{$dp.$D(\'byear1\')}'})"/>
					</span>
				</td>
			</tr>
			<tr>
				<td class="info_tit">整改措施：</td>
				<td><s:radio list="#{'0':'立即整改','1':'限期整改','2':'停产停业整顿'}" value="%{yh.yhZgType}" name="yhGzType" theme="simple"/></td>
			</tr>
			<tr>
				<td class="info_tit">整改责任人：</td>
				<td><input type="text" name="yhGzZrr" value="${yh.yhZgZrr}"/></td>
			</tr>
			<tr>
				<td class="info_tit">责任人电话：</td>
				<td><input type="text" name="yhZrrTel" value="${yh.yhZrrTel}" id="tel1"/><span class="note4"></span></td>
			</tr>
			<tr>
				<td class="info_tit">隐患图片：</td>
				<td id="moreyh">
					<input type="button" name="fj" value="添加附件" id="addMoreyh" class="link_input"/>
					<s:if test="%{fjList1.size>0}">
						<br/>
						<s:iterator id="fj" value="fjList1">
							<span id="yhfj_${fj.id}">
								<a href="<%=filePath%>/${fj.fjPath }" target="_blank" title="点击查看原图"><img src="<%=filePath%>/${fj.fjPath }" border="0" width="80px" height="80px"></a>
								<a href="javascript:deleFj('${fj.id}','yhfj_')" title="删除"><img src="<%=basePath%>/images/deletex.gif"/></a>
							</span>
						</s:iterator>
					</s:if>
				</td>
			</tr>
			<s:if test="%{yhType==1}">
				<tr>
					<td class="info_tit">隐患整改后图片：</td>
					<td id="morezg">
						<input type="button" name="fj1" value="添加附件" id="addMorezg" class="link_input"/>
						<s:if test="%{fjList2.size>0}">
							<br/>
							<s:iterator id="fj" value="fjList2">
								<span id="picfj_${fj.id}">
									<a href="<%=filePath%>/${fj.fjPath }" target="_blank" title="点击查看原图"><img src="<%=filePath%>/${fj.fjPath }" border="0" width="80px" height="80px"></a>
									<a href="javascript:deleFj('${fj.id}','picfj_')" title="删除"><img src="<%=basePath%>/images/deletex.gif"/></a>
								</span>
							</s:iterator>
						</s:if>
					</td>
				</tr>
			</s:if>
			<s:if test="%{yhType==2}">
				<tr>
					<td class="info_tit">隐患报告：</td>
					<td id="moredoc">
						<input type="button" name="fj2" value="添加附件" id="addMoredoc" class="link_input"/>
						<s:if test="%{fjList3.size>0}">
							<br/>
							<s:iterator id="fj" value="fjList3">
								<span id="docfj_${fj.id}">
									<a href="<%=filePath%>/${fj.fjPath }" target="_blank">${fj.fjTitle }</a>
									<a href="javascript:deleFj('${fj.id}','docfj_')" title="删除"><img src="<%=basePath%>/images/deletex.gif"/></a>
								</span>
							</s:iterator>
						</s:if>
					</td>
				</tr>
			</s:if>
			<tr>
				<td colspan="2"  class="info_tit" style="text-align:center;height:35px;">
					<input type="submit" name="btntj" class="input_link" id="btnSubmit" value="提 交"/>&nbsp;&nbsp;&nbsp;
					<input type="button" name="btnset" onclick="toback();" class="input_link" id="bth1" value="返 回"/> 
				</td>
			</tr>
		</table>
		<input type="hidden" name="bgdId" value="${bgdId }">
		<input type="hidden" name="hzdId" value="${hzdId }">
		<input type="hidden" name="cType" value="${cType }">
		<input type="hidden" name="yhType" value="${yhType }">
		<input type="hidden" name="yhId" value="${yhId }">
		<input type="hidden" name="scrollTop" value="${scrollTop }">
	</form>
</body>
<s:if test="%{tip!=null}">
	<script>
		alert('${tip}');
	</script>
</s:if>
</html>
